<?php

namespace Modules\System\Http\Controllers;

/*
 * 声网类
 */

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\System\Services\Agora\ShengWangServices;

class ShengWang extends Controller
{

    public function __construct(Request $request = null){

    }
 
    /**
     * showdoc
     * @catalog 声网
     * @title 获得RtcToken和RtmToken
     * @description 获得RtcToken和RtmToken
     * @method post
     * @url http://cheyoukong.1zhetejia.com/System/ShengWang/AllTokenBuilder?channelName=leapmary&uid=123
     *
     * @param channelName 必选 string  channelName
     * @param uid 必选 int uid
     *
     * @return mixed
     */
    public function AllTokenBuilder(Request $request){

        $i = $request->input();
        $re['RtcToken'] = ShengWangServices::RtcTokenBuilder($i);
        $re['RtmToken'] = ShengWangServices::RtmTokenBuilder($i);
        mdsResponse(200,"获取成功",$re);

    }


    /**
     * showdoc
     * @catalog 声网
     * @title RtcToken
     * @description RtcTokenBuilder
     * @method post
     * @url http://cheyoukong.1zhetejia.com/System/ShengWang/RtcTokenBuilder?channelName=leapmary&uid=123
     *
     * @param channelName 必选 string  channelName
     * @param uid 必选 int uid
     *
     * @return mixed
     */
    public function RtcTokenBuilder(Request $request){

        $i = $request->input();
        $re = ShengWangServices::RtcTokenBuilder($i);
        mdsResponse(200,"获取成功",["token"=>$re]);

    }

    /**
     * showdoc
     * @catalog 声网
     * @title RtmToken
     * @description RtmTokenBuilder
     * @method post
     * @url http://cheyoukong.1zhetejia.com/System/ShengWang/RtmTokenBuilder?uid=123
     *
     * @param uid 必选 int uid
     *
     * @return token
     */
    public function RtmTokenBuilder(Request $request){

        $i = $request->input();
        $re = ShengWangServices::RtmTokenBuilder($i);
        mdsResponse(200,"获取成功",["token"=>$re]);

    }

}
